//
//  NgConfigure.m
//  NgTopOSShove
//
//  Created by yscompany on 2018/11/19.
//  Copyright © 2018 NgTopOS. All rights reserved.
//

#import "NgConfigure.h"
#import <WebKit/WebKit.h>
@implementation NgConfigure
/**
 配置 tableview 的 Estimated***Height 为0 主要是为了适配iOS11 grouped tableview
 
 @param tableView tableView description
 */
+ (void)configTableViewEstimatedHeightZero:(UITableView *)tableView {
    tableView.estimatedRowHeight = 0;
    tableView.estimatedSectionHeaderHeight = 0;
    tableView.estimatedSectionFooterHeight = 0;
}

/**
 tableView 适配 iOS11
 */
+ (void)adaptTableViewForiOS11 {
#ifdef __IPHONE_11_0
    if (@available(iOS 11.0, *)) {
        [UITableView appearance].estimatedRowHeight = 0;
        [UITableView appearance].estimatedSectionHeaderHeight = 0;
        [UITableView appearance].estimatedSectionFooterHeight = 0;
        [UITableView appearance].contentInset = UIEdgeInsetsMake(0, 0, SafeAreaBottomHeight, 0);
        [UIWebView appearance].scrollView.contentInset = UIEdgeInsetsMake(0, 0, SafeAreaBottomHeight, 0);
        [WKWebView appearance].scrollView.contentInset = UIEdgeInsetsMake(0, 0, SafeAreaBottomHeight, 0);
        [UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }
#endif
}
@end
